package com.chixing.day07_abstract.prototype;

public class Job {
    public int jobId;
    public Company company;//关联对象（id、name·····）
    public String jobName;
    public int jobSalaryMin;
    public int jobSalaryMax;
    public String jobDegree;
    public String jobCity;

    public Job(){}
    public Job(int jobId, Company company, String jobName, int jobSalaryMin, int jobSalaryMax, String jobDegree, String jobCity) {
        this.jobId = jobId;
        this.company = company;
        this.jobName = jobName;
        this.jobSalaryMin = jobSalaryMin;
        this.jobSalaryMax = jobSalaryMax;
        this.jobDegree = jobDegree;
        this.jobCity = jobCity;
    }

    public int getJobId() {
        return jobId;
    }

    public void setJobId(int jobId) {
        this.jobId = jobId;
    }

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public String getJobName() {
        return jobName;
    }

    public void setJobName(String jobName) {
        this.jobName = jobName;
    }

    public int getJobSalaryMin() {
        return jobSalaryMin;
    }

    public void setJobSalaryMin(int jobSalaryMin) {
        this.jobSalaryMin = jobSalaryMin;
    }

    public int getJobSalaryMax() {
        return jobSalaryMax;
    }

    public void setJobSalaryMax(int jobSalaryMax) {
        this.jobSalaryMax = jobSalaryMax;
    }

    public String getJobDegree() {
        return jobDegree;
    }

    public void setJobDegree(String jobDegree) {
        this.jobDegree = jobDegree;
    }

    public String getJobCity() {
        return jobCity;
    }

    public void setJobCity(String jobCity) {
        this.jobCity = jobCity;
    }

    @Override
    protected Job clone() throws CloneNotSupportedException {
        Job jobClone = new Job();
        jobClone.jobId = this.jobId;
        jobClone.company =this.company.clone();//关联对象也要克隆一份
        jobClone.jobName = this.jobName;
        jobClone.jobSalaryMax = this.jobSalaryMax;
        jobClone.jobSalaryMin = this.jobSalaryMin;
        jobClone.jobDegree = this.jobDegree;
        jobClone.jobCity = this.jobCity;
        return jobClone;
    }

    @Override
    public String toString() {
        return "Job{" +
                "jobId=" + jobId +
                ", company=" + company +
                ", jobName='" + jobName + '\'' +
                ", jobSalaryMin=" + jobSalaryMin +
                ", jobSalaryMax=" + jobSalaryMax +
                ", jobDegree='" + jobDegree + '\'' +
                ", jobCity='" + jobCity + '\'' +
                '}';
    }
}
